package zoo.member.admin.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import zoo.member.admin.dao.AdminDao;
import zoo.member.admin.util.StringUtil;
import zoo.member.domain.MemberCommand;

@Controller
public class AdminMemberDetailListController {

	private static Log log = LogFactory.getLog(AdminMemberDetailListController.class);
	@Autowired
	private AdminDao admindDao;
	
	@RequestMapping("/admin/detail.do")
	public ModelAndView process(@RequestParam("userid")String userid){
		if(log.isDebugEnabled()){
			log.debug("userid : " + userid);
		}
				
		MemberCommand member = admindDao.selectMember(userid);

		//주소 줄바꿈 처리
		member.setUresaddr(StringUtil.parseBr(member.getUresaddr()));
		
		return new ModelAndView("admin_popup/detail-member-list","member",member);
	}
}
